﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace DcsGauges.Input.Events
{
    class MouseEvent
    {
        public enum EventTypes
        {
            MouseDown,
            MouseUp,
            MouseMove,
        }

        [Flags]
        public enum MouseButtons
        {
            None            = 0x00,
            Left            = 0x01,
            Middle          = 0x02,
            Right           = 0x04,
        }

        public EventTypes   EventType               { get; private set; }
        public Point        ScreenCoordinates       { get; private set; }
        public Point?       ElementCoordinates      { get; private set; }
        public MouseButtons Button                  { get; private set; }
        public int          DeltaX                  { get; private set; }
        public int          DeltaY                  { get; private set; }
        public bool         WasHandeled             { get; set; }

        public MouseEvent(EventTypes eventType, MouseButtons button, Point screenCoordinates, int dx = 0, int dy = 0)
        {
            this.EventType              = eventType;
            this.ScreenCoordinates      = screenCoordinates;
            this.Button                 = button;
            this.WasHandeled            = false;
        }

        public MouseEvent(EventTypes eventType, MouseButtons button, Point screenCoordinates, Point elementCoordinates, int dx = 0, int dy = 0) : this(eventType, button, screenCoordinates, dx, dy)
        {
            this.ElementCoordinates     = elementCoordinates;
        }
    }
}
